home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / var / lib / dpkg / info / system-tools-backends.preinst < prev    next >
Text File  |  2009-10-20  |  1KB  |  40 lines

  1. #!/bin/sh
  2. set -e
  3.  
  4. # stop backend here when upgrading from a version that didn't handle
  5. # it correctly yet in the prerm
  6.  
  7. # Remove a no-longer used conffile
  8. rm_conffile() {
  9.     PKGNAME="$1"
  10.     CONFFILE="$2"
  11.  
  12.     if [ -e "$CONFFILE" ]; then
  13.         md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
  14.         old_md5sum="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\' $CONFFILE'{s/ obsolete$//;s/.* //p}\"`"
  15.         if [ "$md5sum" != "$old_md5sum" ]; then
  16.             echo "Obsolete conffile $CONFFILE has been modified by you."
  17.             echo "Saving as $CONFFILE.dpkg-bak ..."
  18.             mv -f "$CONFFILE" "$CONFFILE".dpkg-bak
  19.         else
  20.             echo "Removing obsolete conffile $CONFFILE ..."
  21.             rm -f "$CONFFILE"
  22.         fi
  23.     fi
  24. }
  25. case "$1" in
  26.     install|upgrade)
  27.         if dpkg --compare-versions "$2" lt-nl 2.2.1-5; then
  28.             test -x /etc/dbus-1/event.d/70system-tools-backends && \
  29.                 /etc/dbus-1/event.d/70system-tools-backends stop || true
  30.             rm_conffile system-tools-backends "/etc/dbus-1/event.d/70system-tools-backends"
  31.         fi
  32.         if dpkg --compare-versions "$2" lt-nl 2.6.0-3; then
  33.             rm_conffile system-tools-backends "/etc/init.d/system-tools-backends"
  34.             update-rc.d system-tools-backends remove
  35.         fi
  36.         ;;
  37. esac
  38.  
  39.  
  40.